import request from '../../../components/Request';

/**
 * 提交登录信息
 * @param values
 * @returns {Promise<void>}
 */
export async function submit(values) {
  let res = await request.post({
    url: './public/login.do',
    data: values,
  });
  return res;
}

/**
 * 根据变量名获取匹配值
 */
function getQueryString(name) {
  let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  let r = window.location.search.substr(1).match(reg);
  return r != null ? unescape(r[2]) : null;
}

/**
 * 获取应用系统参数信息
 * @returns {Promise<*>}
 */
export async function listCfg() {
  let res = await request.post({
    url: './public/listCfg.do',
  });
  return res.data;
}
